﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Net.TCP
{
    public abstract class  BaseCallback<T> : ICallbackHandler where T : class
    {
        public void Handle(Package package)
        {
            T dataContract = BufferUtil.FromData<T>(package.Data);

            OnHandle(package, dataContract);
        }


        protected abstract void OnHandle(Package package, T data);
    }
}
